package com.order.order.Feign;

import com.order.order.entity.User;
import org.springframework.stereotype.Component;

/**
 * 此类中的方法专门用于服务降级，该类一般要实现调用远程服务的接口（这样保证方法名一致）
 */
@Component
public class FeignFeignService implements FeignFeignClient {

    @Override
    public String test(String name) {
        return new Item(100000L, "服务挂了", null, name, 100000L).toString();
    }

    @Override
    public String test2(Long id) {
        return new Item(2L, "服务挂了", null, String.valueOf(id), 2L).toString();
    }

    @Override
    public String test4(String string) {
        return new Item(3L, "服务挂了", "", string, 3L).toString();
    }

    @Override
    public User test3(Long id) {
        User user = new User();
        user.setHello("服务挂了"+id);
        return user;
    }
}